package com.train.classeval.mapper;

import com.train.classeval.entity.IndexOV;
import com.train.classeval.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xs
 * @since 2021-10-08
 */
public interface RoleMapper extends BaseMapper<Role> {
    /**
     * 根据用户id查询所有角色
     */
    List<Role> selectRolesByUserId(long userId);

    /**
     * 添加角色数据层
     * @param uid
     * @param rid
     * @return
     */
    int addRole(@Param("uid") Integer uid,@Param("rid") Integer rid);

    /**
     * 查看当前用户角色
     * @param uid
     * @param rid
     * @return
     */
    int selectUserRole(@Param("uid") Integer uid,@Param("rid") Integer rid);
}
